﻿using System;
using System.Collections.Generic;
using System.Text;

namespace StockTrader.BusinessService.DataContract.HnxInfo
{
    public class HnxTopPriceData
    {
        public DateTime TradingDate { set; get; }
        public int StockId { set; get; }
        public int Bq3 { set; get; }
        public int Bp3 { set; get; }
        public int Bq2 { set; get; }
        public int Bp2 { set; get; }
        public int Bq1 { set; get; }
        public int Bp1 { set; get; }
        public int Sq1 { set; get; }
        public int Sp1 { set; get; }
        public int Sq2 { set; get; }
        public int Sp2 { set; get; }
        public int Sq3 { set; get; }
        public int Sp3 { set; get; }
        public long TimeStamp { set; get; }

        public HnxTopPriceData() { }
        public HnxTopPriceData(DateTime trading, decimal id, decimal bq3, decimal bp3, decimal bq2, decimal bp2, decimal bq1,
            decimal bp1, decimal sq1, decimal sp1, decimal sq2, decimal sp2, decimal sq3, decimal sp3)
        {
            this.TradingDate = trading;
            this.StockId = Convert.ToInt32(id);
            this.Bq3 = Convert.ToInt32(bq3);
            this.Bp3 = Convert.ToInt32(bp3);
            this.Bq2 = Convert.ToInt32(bq2);
            this.Bp2 = Convert.ToInt32(bp2);
            this.Bq1 = Convert.ToInt32(bq1);
            this.Bp1 = Convert.ToInt32(bp1);
            this.Sq1 = Convert.ToInt32(sq1);
            this.Sp1 = Convert.ToInt32(sp1);
            this.Sq2 = Convert.ToInt32(sq2);
            this.Sp2 = Convert.ToInt32(sp2);
            this.Sq3 = Convert.ToInt32(sq3);
            this.Sp3 = Convert.ToInt32(sp3);
            this.TimeStamp = DateTime.Now.Ticks;
        }

        #region IComparable Members

        public override bool Equals(object obj)
        {
            HnxTopPriceData tp = (HnxTopPriceData)obj;
            return Bq3.Equals(tp.Bq3) && Bp3.Equals(tp.Bp3) && Bp2.Equals(tp.Bp2) && Bp2.Equals(tp.Bp2) && Bp1.Equals(tp.Bp1) && Bp1.Equals(tp.Bp1) && Sp1.Equals(tp.Sp1) && Sq1.Equals(tp.Sq1) && Sq2.Equals(tp.Sq2) && Sp2.Equals(tp.Sp2) && Sp3.Equals(tp.Sp3) && Sq3.Equals(tp.Sq3);
        }


        #endregion

    }
}
